home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 April
/
EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso
/
EARCD
/
text
/
print
/
audioed.lha
/
AudioED313
/
Install-AudioED
next >
Wrap
Text File
|
1996-11-17
|
38KB
|
1,345 lines
;--------------------------------------------------------------------------
;
; $VER: AudioED V 3.13 (06.10.96)
;
; Copyright © 1996 by Frank Enderle
;
; This is the installation script for the Amiga Technologies Installer (tm)
;
;--------------------------------------------------------------------------
; init section
(onerror (exit (quiet)))
(set new-ver 3)
(set new-rev 13)
(set drawer-name "AudioED")
(set def-volume "SYS:")
(set do-update 0)
(set do-install 0)
(set do-remove 0)
(set cat-lang 0)
(set man-lang 0)
;==========================================================================
; LOCALES
;----- Language: Deutsch -----
(if (= @language "deutsch")
(
(set #wrong-kickstart (cat "\n"
"Tut mir Leid, aber AudioED benötigt\n"
"mindestens Kickstart 3.0 um gestartet\n"
"werden zu können."
)
)
(set #welcome (cat "\n"
"Willkommen bei dem Installer-Skript für\n"
"\n"
"AudioED Version 3.13\n"
"\n"
"Alle Dateien dieser Distribution sind\n"
"Copyright © 1994-96 by Frank Enderle"
)
)
(set #getdrawer (cat "Wählen Sie ein Verzeichnis, in dem AudioED "
"installiert werden soll. "
"Dieses Skript erzeugt dort bei der Installation "
"ein Verzeichnis mit dem Namen 'AudioED'\n\n"
"Ist bereits eine AudioED Version installiert, "
"so können Sie diese updaten oder löschen."
)
)
(set #getdrawer-help (cat "Wählen Sie ein Verzeichnis aus, in welchem AudioED "
"installiert werden soll bzw. bereits installiert ist. "
"Das Skript erzeugt dort bei der Installation (und nur "
"dann) ein Verzeichnis mit dem Namen 'AudioED' Ist "
"bereits eine AudioED Version installiert, so können "
"Sie diese updaten oder löschen."
)
)
(set #deinstall (cat "Es ist bereits diese Version von AudioED "
"installiert. Wollen Sie diese löschen? "
)
)
(set #deinst-update (cat "Es ist bereits eine Version von AudioED "
"installiert. Bitte wählen Sie, ob Sie ein "
"Update durchführen möchten, oder ob AudioED "
"gelöscht werden soll."
)
)
(set #deinst-ch-0 (cat "Update durchführen (empfohlen)"
)
)
(set #deinst-ch-1 (cat "AudioED entfernen"
)
)
(set #reinit-key (cat "Es ist bereits diese Version von AudioED "
"installiert. "
)
)
(set #reinit-ch-0 (cat "AudioED entfernen"
)
)
(set #reinit-ch-1 (cat "Keyfile neu installieren"
)
)
(set #lang-cat (cat "Welche Sprachkataloge möchten Sie installieren?"
)
)
(set #lang-cat-ch-0 (cat "English"
)
)
(set #lang-cat-ch-1 (cat "Deutsch"
)
)
(set #lang-cat-ch-2 (cat "Svenska"
)
)
(set #lang-cat-ch-3 (cat "Français"
)
)
(set #lang-man (cat "Welche Anleitungen sollen installiert werden?"
)
)
(set #lang-man-ch-0 (cat "English"
)
)
(set #lang-man-ch-1 (cat "Deutsch"
)
)
(set #lang-error (cat "\nSie müssen mindestens eine Sprache auswählen"
)
)
(set #user-startup (cat "Es müssen ein paar Zeilen in die Datei \"s:user-startup\" "
"eingebunden werden."
)
)
(set #user-startup-rm (cat "Es müssen ein paar Zeilen in der Datei \"s:user-startup\" "
"entfernt werden."
)
)
(set #removed (cat "AudioED wurde komplett gelöscht"
)
)
(set #gettapes (cat "In welchem Verzeichnis sind Ihre Kassetten gespeichert? Wählen "
"Sie das Verzeichnis aus, IN DEM die .idx und .dat Dateien gespeichert "
"sind!!!"
)
)
(set #update-info-0 (cat "Das alte Verzeichnis wird in AudioED_old umbenannt. Es "
"werden keine Dateien darin verändert. Sollte die neue "
"Version nicht korrekt funktionieren, so können Sie "
"dennoch die alte Version von AudioED benutzen."
)
)
(set #update-info-1 (cat "Die Dateien, welche aus dem System entfernt werden müssen, "
"werden in AudioED_old/backups mit ihrer Pfadstruktur gespeichert."
)
)
(set #work-r-conv (cat "Konvertiere Konfigurationsdateien..."
)
)
(set #work-d-conv (cat "Konvertiere Datenbank(en)..."
)
)
(set #work-backup (cat "Erstelle Sicherheitskopien..."
)
)
(set #no-keyfile (cat "\nDieses Archiv ist nicht registriert. Um AudioED voll "
"funktionsfähig zu machen, müssen Sie sich registrieren "
"lassen. Lesen Sie den Punkt 'Registrieren' in der "
"Anleitung zu AudioED."
)
)
(set #restart (cat "\nUm AudioED korrekt starten zu können, müssen Sie nach "
"beenden des Installationsvorgangs den Rechner neu starten."
)
)
(set #no-lha (cat "\nUm AudioED zu installieren benötigen Sie LHA, was ich "
"aus rechtlichen Gründen dem Archiv nicht beifügen konnte. "
"Sie können es aber jederzeit vom Aminet beziehen. "
)
)
(set #extract-prg-0 (cat "\nEntpacke AudioED für 68000..."
)
)
(set #extract-prg-1 (cat "\nEntpacke AudioED für 68020+..."
)
)
(set #extract-err (cat "\nFehler beim entpacken des Archivs"
)
)
)
;----- Language: English -----
(
(set #wrong-kickstart (cat "\n"
"I'm sorry but AudioED needs at least\n"
"Kickstart 3.0 to do its work."
)
)
(set #welcome (cat "\n"
"Welcome to the Installer-Script for\n"
"\n"
"AudioED Version 3.13\n"
"\n"
"All file in this distribution are\n"
"Copyright © 1994-96 by Frank Enderle"
)
)
(set #getdrawer (cat "Please select a drawer where to install AudioED. "
"This script will create a directory named 'AudioED' "
"while the installation procedure.\n\n"
"If there's already an AudioED version installed, "
"you will be asked if you want to update or remove it."
)
)
(set #getdrawer-help (cat "Please select a drawer where to install AudioED or "
"where AudioED is already installed. This script will "
"create a directory named 'AudioED' while (and only then) "
"the installation procedure. If there's already an "
"AudioED version installed, you will ask be asked if you "
"want to update or remove it."
)
)
(set #deinstall (cat "There's already this version of AudioED installed. "
"Do you want to delete that installation?"
)
)
(set #deinst-update (cat "There's already a version of AudioED installed. "
"Please select if you want to perform an update "
"or if you wish to delete the installation."
)
)
(set #deinst-ch-0 (cat "Perform update (recommended)"
)
)
(set #deinst-ch-1 (cat "Remove AudioED"
)
)
(set #reinit-key (cat "There's already this version of AudioED installed. "
)
)
(set #reinit-ch-0 (cat "Remove AudioED"
)
)
(set #reinit-ch-1 (cat "Reinstall keyfile"
)
)
(set #lang-cat (cat "Select which languages-catalogs you wish to "
"have installed"
)
)
(set #lang-cat-ch-0 (cat "English"
)
)
(set #lang-cat-ch-1 (cat "Deutsch"
)
)
(set #lang-cat-ch-2 (cat "Svenska"
)
)
(set #lang-cat-ch-3 (cat "Français"
)
)
(set #lang-man (cat "Which manuals should be installed?"
)
)
(set #lang-man-ch-0 (cat "English"
)
)
(set #lang-man-ch-1 (cat "Deutsch"
)
)
(set #lang-error (cat "\nYou must select at least one language"
)
)
(set #user-startup (cat "Some commands will be added to your "
"\"s:user-startup\" file."
)
)
(set #user-startup-rm (cat "Some commands will be removed from your "
"\"s:user-startup\" file."
)
)
(set #removed (cat "AudioED was entirely removed."
)
)
(set #gettapes (cat "In which directory have you saved your tapes? Select "
"the directory WHICH CONTAINS the .idx and .dat files!!!"
)
)
(set #update-info-0 (cat "The old directory will be renamed to AudioED_old. No "
"files will be changed in that directory. If the new "
"version won't work then you can use at least the "
"old version of AudioED."
)
)
(set #update-info-1 (cat "The file which must be removed from the system will be saved "
"with their directory structure in AudioED_old/backups."
)
)
(set #work-r-conv (cat "Converting configuration files..."
)
)
(set #work-d-conv (cat "Converting database(s)..."
)
)
(set #work-backup (cat "Creating backups..."
)
)
(set #no-keyfile (cat "\nThis archive is unregistered. To get AudioED in the "
"full version you need to get registered. Read the topic "
"'Register' in the AudioED manual."
)
)
(set #restart (cat "\nTo get AudioED working without problems you'll have to "
"restart the computer after you completed the install "
"procedure."
)
)
(set #no-lha (cat "\nTo install AudioED it is required that LHA is installed. "
"I can't include LHA due to license reasons into this distribution "
"but you can easily get it from the Aminet. "
)
)
(set #extract-prg-0 (cat "\nExtracting AudioED for 68000..."
)
)
(set #extract-prg-1 (cat "\nExtracting AudioED for 68020+..."
)
)
(set #extract-err (cat "\nError while extracting archive"
)
)
)
)
;==========================================================================
; PROCEDURES
;--------------------------------------------------------------------------
; Installation procedure. Installs AudioED and is used while install and
; update progress.
(procedure INSTALL
(
; first clear the directory
; (we use the external delete to be compatible to verion 2 of installer)
(run (cat "c:delete \"" destination-drawer "/#?\" all force quiet"))
; now we copy the related language independent files
; drawer icon
(copyfiles (source "Install/audioed_drawer_icon")
(dest (pathonly destination-drawer))
(newname "AudioED.info")
)
; readme file
(copyfiles (source "Install/ReadMe")
(dest destination-drawer)
(infos)
)
; installer skript which also uninstalls AudioED
(copyfiles (source "Install-AudioED")
(dest destination-drawer)
(newname "Uninstall-AudioED")
)
(copyfiles (source "Install/uninstall_icon")
(dest destination-drawer)
(newname "Uninstall-AudioED.info")
)
; registration program
(copyfiles (source "Install/Register")
(dest destination-drawer)
)
(copyfiles (source "Install/ ")
(dest destination-drawer)
(infos)
)
; main program
(if (< "68010" (database "cpu"))
(
; install for 68020+
(working #extract-prg-1)
(if (<> (run (cat "lha x Install/audioed_prg.lha AudioED_020 \"" destination-drawer "/\"")))
(
(abort #extract-err)
)
)
(rename (tackon destination-drawer "AudioED_020") (tackon destination-drawer "AudioED"))
)
(
; install for 68000
(working #extract-prg-0)
(if (<> (run (cat "lha x Install/audioed_prg.lha AudioED_000 \"" destination-drawer "/\"")))
(
(abort #extract-err)
)
)
(rename (tackon destination-drawer "AudioED_000") (tackon destination-drawer "AudioED"))
)
)
(copyfiles (source "Install/AudioED.info")
(dest destination-drawer)
)
; library
(copyfiles (source "Install/Libs")
(dest (tackon destination-drawer "Libs"))
(infos)
(all)
)
(copyfiles (source "Install/Libs.info")
(dest destination-drawer)
)
; tapes
(copyfiles (source "Install/Tapes")
(dest (tackon destination-drawer "Tapes"))
(infos)
(all)
)
(copyfiles (source "Install/Tapes.info")
(dest destination-drawer)
)
; language related files
; manuals
(makedir (tackon destination-drawer "Docs"))
(copyfiles (source "Install/Docs.info")
(dest destination-drawer)
)
(if (BITAND man-lang 1)
(
; english manual
(copyfiles (source "Install/Docs/English")
(dest (tackon destination-drawer "Docs/English"))
(infos)
(all)
)
(copyfiles (source "Install/Docs/English.info")
(dest (tackon destination-drawer "Docs"))
)
)
)
(if (BITAND man-lang 2)
(
; german manual
(copyfiles (source "Install/Docs/Deutsch")
(dest (tackon destination-drawer "Docs/Deutsch"))
(infos)
(all)
)
(copyfiles (source "Install/Docs/Deutsch.info")
(dest (tackon destination-drawer "Docs"))
)
)
)
; catalogs
(makedir (tackon destination-drawer "Locale"))
(copyfiles (source "Install/Locale.info")
(dest destination-drawer)
)
; developer material
(copyfiles (source "Install/Locale/AudioED_Strings.cd")
(dest (tackon destination-drawer "Locale"))
)
; catalog files
(makedir (tackon destination-drawer "Locale/catalogs"))
; english must not be processed since its the builtin language
(if (BITAND cat-lang 2)
(
; german locales
(copyfiles (source "Install/Locale/catalogs/deutsch")
(dest (tackon destination-drawer "Locale/catalogs/deutsch"))
(all)
)
(copyfiles (source "Install/Locale/AudioED_deutsch.ct")
(dest (tackon destination-drawer "Locale"))
)
)
)
(if (BITAND cat-lang 4)
(
; swedish locales
(copyfiles (source "Install/Locale/catalogs/svenska")
(dest (tackon destination-drawer "Locale/catalogs/svenska"))
(all)
)
(copyfiles (source "Install/Locale/AudioED_svenska.ct")
(dest (tackon destination-drawer "Locale"))
)
)
)
(if (BITAND cat-lang 8)
(
; swedish locales
(copyfiles (source "Install/Locale/catalogs/français")
(dest (tackon destination-drawer "Locale/catalogs/français"))
(all)
)
(copyfiles (source "Install/Locale/AudioED_français.ct")
(dest (tackon destination-drawer "Locale"))
)
)
)
; here we install the keyfile but only if there's no keyfile installed
(if (NOT (exists "ENVARC:AudioED.key"))
(
; lets see if the given file is a real or a dummy keyfile
(if keyfile-present
(
; keyfile available
(copyfiles (source "Keyfile/AudioED.key")
(dest "ENVARC:")
)
(copyfiles (source "ENVARC:AudioED.key")
(dest "ENV:")
)
)
(
; no keyfile... show user a message
(message #no-keyfile)
)
)
)
)
; now we have to manipulate the user-startup
(startup "AudioED"
(prompt #user-startup)
(help @startup-help)
(command "; derived from MUI-Startup-Code Copyright © Stefan Stuntz\n\n")
(command "if exists \"" destination-drawer "\"\n")
(command " if exists \"" destination-drawer "/Libs\"\n")
(command " assign add LIBS: \"" destination-drawer "/Libs\"\n")
(command " endif\n\n")
(command " if exists \"" destination-drawer "/Locale\"\n")
(command " assign add LOCALE: \"" destination-drawer "/Locale\"\n")
(command " endif\n\n")
(command " version >nil: exec.library 39\n")
(command " if not warn\n")
(command " if exists \"" destination-drawer "/Docs\"\n")
(command " if exists HELP:dummy ; do not remove\n")
(command " endif ; this entry!\n")
(command " assign add HELP: \"" destination-drawer "/Docs\"\n")
(command " endif\n")
(command " endif\n")
(command "endif")
)
)
)
;--------------------------------------------------------------------------
; Update existing AudioED installation.
(procedure UPDATE
(
; should we do a minor update?
(if (AND (= old-ver 3) (= old-rev 12))
(
; MINOR UPDATE
; in this case we just copy the main program, the manuals and the locale files
; readme file
(copyfiles (source "Install/ReadMe")
(dest destination-drawer)
(infos)
)
; installer skript which also uninstalls AudioED
(copyfiles (source "Install-AudioED")
(dest destination-drawer)
(newname "Uninstall-AudioED")
)
; registration program
(copyfiles (source "Install/Register")
(dest destination-drawer)
)
; main program
(delete (tackon destination-drawer "AudioED") (optional force)
)
(if (< "68010" (database "cpu"))
(
; install for 68020+
(working #extract-prg-1)
(if (<> (run (cat "lha x Install/audioed_prg.lha AudioED_020 \"" destination-drawer "/\"")))
(
(abort #extract-err)
)
)
(rename (tackon destination-drawer "AudioED_020") (tackon destination-drawer "AudioED"))
)
(
; install for 68000
(working #extract-prg-0)
(if (<> (run (cat "lha x Install/audioed_prg.lha AudioED_000 \"" destination-drawer "/\"")))
(
(abort #extract-err)
)
)
(rename (tackon destination-drawer "AudioED_000") (tackon destination-drawer "AudioED"))
)
)
; language related files
; manuals
(makedir (tackon destination-drawer "Docs"))
(copyfiles (source "Install/Docs.info")
(dest destination-drawer)
)
(if (BITAND man-lang 1)
(
; english manual
(copyfiles (source "Install/Docs/English")
(dest (tackon destination-drawer "Docs/English"))
(infos)
(all)
)
(copyfiles (source "Install/Docs/English.info")
(dest (tackon destination-drawer "Docs"))
)
)
)
(if (BITAND man-lang 2)
(
; german manual
(copyfiles (source "Install/Docs/Deutsch")
(dest (tackon destination-drawer "Docs/Deutsch"))
(infos)
(all)
)
(copyfiles (source "Install/Docs/Deutsch.info")
(dest (tackon destination-drawer "Docs"))
)
)
)
; catalogs
(makedir (tackon destination-drawer "Locale"))
(copyfiles (source "Install/Locale.info")
(dest destination-drawer)
)
; developer material
(copyfiles (source "Install/Locale/AudioED_Strings.cd")
(dest (tackon destination-drawer "Locale"))
)
; catalog files
(makedir (tackon destination-drawer "Locale/catalogs"))
; english must not be processed since its the builtin language
(if (BITAND cat-lang 2)
(
; german locales
(copyfiles (source "Install/Locale/catalogs/deutsch")
(dest (tackon destination-drawer "Locale/catalogs/deutsch"))
(all)
)
(copyfiles (source "Install/Locale/AudioED_deutsch.ct")
(dest (tackon destination-drawer "Locale"))
)
)
)
(if (BITAND cat-lang 4)
(
; swedish locales
(copyfiles (source "Install/Locale/catalogs/svenska")
(dest (tackon destination-drawer "Locale/catalogs/svenska"))
(all)
)
(copyfiles (source "Install/Locale/AudioED_svenska.ct")
(dest (tackon destination-drawer "Locale"))
)
)
)
(if (BITAND cat-lang 8)
(
; swedish locales
(copyfiles (source "Install/Locale/catalogs/français")
(dest (tackon destination-drawer "Locale/catalogs/français"))
(all)
)
(copyfiles (source "Install/Locale/AudioED_français.ct")
(dest (tackon destination-drawer "Locale"))
)
)
)
)
(
; MAJOR UPDATE
; tell user what we are going to do
(message #update-info-0)
; rename existing drawer
(set update-drawer (cat destination-drawer "_old"))
(rename destination-drawer update-drawer)
(rename (cat destination-drawer ".info") (cat update-drawer ".info"))
; inform user about our backups
(message #update-info-1)
; create backups
(makedir (tackon update-drawer "backup"))
(working #work-backup)
; backup locale files
(if (exists "LOCALE:catalogs/deutsch/audioed.catalog")
(
(makedir (tackon update-drawer "backup/catalogs"))
(makedir (tackon update-drawer "backup/catalogs/deutsch"))
(copyfiles (source "LOCALE:catalogs/deutsch/audioed.catalog")
(dest (tackon update-drawer "backup/catalogs/deutsch" ))
(infos)
)
(delete "LOCALE:catalogs/deutsch/audioed.catalog" (optional force)
(infos)
)
)
)
(if (exists "LOCALE:catalogs/italiano/audioed.catalog")
(
(makedir (tackon update-drawer "backup/catalogs"))
(makedir (tackon update-drawer "backup/catalogs/italiano"))
(copyfiles (source "LOCALE:catalogs/italiano/audioed.catalog")
(dest (tackon update-drawer "backup/catalogs/italiano" ))
(infos)
)
(delete "LOCALE:catalogs/italiano/audioed.catalog" (optional force)
(infos)
)
)
)
; backup library
(if (exists "LIBS:idx.library")
(
(makedir (tackon update-drawer "backup/libs"))
(copyfiles (source "LIBS:idx.library")
(dest (tackon update-drawer "backup/libs" ))
(infos)
)
(delete "LIBS:idx.library" (optional force)
(infos)
)
)
)
; backup envarc file
(if (exists "ENVARC:AudioED.resident")
(
(makedir (tackon update-drawer "backup/envarc"))
(copyfiles (source "ENVARC:AudioED.resident")
(dest (tackon update-drawer "backup/envarc" ))
(infos)
)
(delete "ENVARC:AudioED.resident" (optional force)
(infos)
)
)
)
; backup tapes
; ask where the tape have been installed on previous versions
(set tapes-drawer (askdir (prompt #gettapes)
(help @askdir-help)
(default def-volume)
)
)
(if (exists tapes-drawer)
(
(makedir (tackon update-drawer "backup/TapesBackup"))
(foreach tapes-drawer "(#?.idx|#?.dat)"
(
(copyfiles (source (tackon tapes-drawer @each-name))
(dest (tackon update-drawer "backup/TapesBackup"))
(infos)
)
)
)
; (we use the external delete to be compatible to verion 2 of installer)
(run (cat "c:delete \"" (tackon tapes-drawer "#?.idx") "\" all force quiet"))
(run (cat "c:delete \"" (tackon tapes-drawer "#?.dat") "\" all force quiet"))
)
)
; create drawer for new installation
(makedir destination-drawer)
; do installation
(INSTALL)
; convert the resident file
(if (exists (tackon update-drawer "backup/envarc/audioed.resident"))
(
(working #work-r-conv)
(run (cat "Install/old2new \"" (tackon update-drawer "backup/envarc/audioed.resident") "\" CONFIG"))
; copy files to envarc
(copyfiles (source "ENV:AudioED")
(dest "ENVARC:AudioED")
(all)
(infos)
)
)
)
; convert the databases
(foreach (tackon update-drawer "backup/TapesBackup") "#?.idx"
(
(working #work-d-conv)
; get name without extension
(set database-name (substr @each-name 0 (- (strlen @each-name) 4)))
; start conversion
; that looks really weird, but it works fine ;)
(run (cat "Install/old2new \""
(tackon update-drawer (cat "backup/" (fileonly tapes-drawer) "/" database-name))
"\" \""
(tackon destination-drawer (cat "Tapes/" database-name)) "\" DATABASE"
)
)
)
)
)
)
)
)
;--------------------------------------------------------------------------
; Remove an existing AudioED installation.
(procedure REMOVE
(
; remove drawer
; (we use the external delete to be compatible to verion 2 of installer)
(run (cat "c:delete \"" destination-drawer "\" all force quiet"))
; remove envarc
; (we use the external delete to be compatible to verion 2 of installer)
(run "c:delete \"ENVARC:AudioED\" all force quiet")
(delete "ENVARC:AudioED.key" (optional force)
(infos)
)
; remove startup lines
(startup "AudioED"
(prompt #user-startup-rm)
(help @startup-help)
)
)
)
;==========================================================================
; MAIN INSTALLATION
;--------------------------------------------------------------------------
; Check Kickstart version. Needs at least version 3.0 (V39).
(if (< (/ (getversion "exec.library" (resident)) 65536) 39 )
(
(abort #wrong-kickstart)
)
)
;--------------------------------------------------------------------------
; Check wheather lha is available or not
(if (= (run "lha >NIL:") 10)
(
(abort #no-lha)
)
)
;--------------------------------------------------------------------------
; Check for the keyfile
(if (exists "Keyfile/AudioED.key")
(
(if (<> (getsum "Keyfile/AudioED.key") $B81AA1DC)
(
(set keyfile-present 1)
)
(
(set keyfile-present 0)
)
)
)
)
;--------------------------------------------------------------------------
; Show welcome message.
(message #welcome)
;--------------------------------------------------------------------------
; Ok... let's start. Get name of Drawer.
(set destination-drawer (askdir (prompt #getdrawer)
(help #getdrawer-help)
(default def-volume)
)
)
; Create full name
(set destination-drawer (tackon destination-drawer "AudioED"
)
)
;--------------------------------------------------------------------------
; If this drawer exists we try to obtain the version of the installed
; AudioED. Else we create it silently.
(if (exists (tackon destination-drawer drawer-name))
(
; directory exists so check for old version
; and say the script to ask for deleteing this
; version
(set ask-remove 1)
; get version and revision number
(set old-version (getversion (tackon destination-drawer "AudioED")))
(set old-ver (/ old-version 65536))
(set old-rev (- old-version (* old-ver 65536)))
; is there an older version?
(if (OR (< old-ver new-ver) (< old-rev new-rev))
(
; say skript to ask for update
(set ask-update 1)
)
(
(set ask-update 0)
)
)
)
(
(set ask-remove 0)
; drawer was not found so we create it
(makedir destination-drawer)
)
)
;--------------------------------------------------------------------------
; Ask the user if he or she wants to update or delete
(if ask-update
(
; ask for update or remove
(set install-choice (askchoice (prompt #deinst-update)
(choices #deinst-ch-0
#deinst-ch-1
)
(default 0)
(help @askchoice-help)
)
)
(if (= install-choice 0)
(
; update selected
(set do-update 1)
)
(
; remove selected
(set do-remove 1)
)
)
)
(if ask-remove
(
(if keyfile-present
(
; ask for remove or keyfile update
(set install-choice (askchoice (prompt #reinit-key)
(choices #reinit-ch-0
#reinit-ch-1
)
(default 0)
(help @askchoice-help)
)
)
(if (= install-choice 0)
(
; remove installation
(set do-remove 1)
)
(
; copy the keyfile
(copyfiles (source "Keyfile/AudioED.key")
(dest "ENVARC:")
)
(copyfiles (source "ENVARC:AudioED.key")
(dest "ENV:")
)
; and that's it
(exit (quiet))
)
)
)
(
(if (askbool (prompt #deinstall)
(help @askbool-help)
(default 0)
)
(
; yes selected - so we remove
(set do-remove 1)
)
(
; no selected - so we quit
(exit (quiet))
)
)
)
)
)
(
; no remove and no update so we install
(set do-install 1)
)
)
)
;--------------------------------------------------------------------------
; Ask the user which catalog files should be installed.
(if (NOT do-remove)
(
(until (NOT (= cat-lang 0))
(
; set default language
(set cat-lang 1)
(if (= @language "deutsch") (set cat-lang 2))
(if (= @language "svenska") (set cat-lang 4))
(if (= @language "français") (set cat-lang 8))
(set cat-lang (askoptions (prompt #lang-cat)
(choices #lang-cat-ch-0
#lang-cat-ch-1
#lang-cat-ch-2
#lang-cat-ch-3
)
(default cat-lang)
(help @askoptions-help)
)
)
(if (= cat-lang 0)
(
; alert user if he made a wrong choice
(message #lang-error)
)
)
)
)
)
)
;--------------------------------------------------------------------------
; Ask the user which manuals should be installed.
(if (NOT do-remove)
(
(until (NOT (= man-lang 0))
(
; set default language
(set man-lang 1)
(if (= @language "deutsch") (set man-lang 2))
(if (= @language "svenska") (set man-lang 4))
(if (= @language "français") (set man-lang 8))
(set man-lang (askoptions (prompt #lang-man)
(choices #lang-man-ch-0
#lang-man-ch-1
)
(default man-lang)
(help @askoptions-help)
)
)
(if (= man-lang 0)
(
; alert user if he made a wrong choice
(message #lang-error)
)
)
)
)
)
)
;--------------------------------------------------------------------------
; We got now all the required information. So let's start with the
; installation procedure.
(if do-install
(
; do full new installation
(INSTALL)
(message #restart)
(exit (quiet))
)
)
(if do-update
(
; do update installation
(UPDATE)
(message #restart)
(exit (quiet))
)
)
(if do-remove
(
; remove the installation
(REMOVE)
(message #removed)
(exit (quiet))
)
)
(exit)